package com.twu.biblioteca.entity;

public class User extends Base {
  private final String name;
  private final String libraryNumber;
  private String email;
  private String address;
  private String phoneNumber;
  private String password;

  public User(String name, String libraryNumber) {
    boolean matches = libraryNumber.matches("\\w{3}-\\w{4}");
    if (!matches)
      throw new IllegalArgumentException("libraryNumber shall be XXX-XXXX");

    this.name = name;
    this.libraryNumber = libraryNumber;
  }

  public String getLibraryNumber() {
    return libraryNumber;
  }

  public String getName() {
    return name;
  }

  public String getEmail() {
    return email;
  }

  public void setEmail(String email) {
    this.email = email;
  }

  public String getAddress() {
    return address;
  }

  public void setAddress(String address) {
    this.address = address;
  }

  public String getPhoneNumber() {
    return phoneNumber;
  }

  public void setPhoneNumber(String phoneNumber) {
    this.phoneNumber = phoneNumber;
  }

  public String getPassword() {
    return password;
  }

  public void setPassword(String password) {
    this.password = password;
  }
}
